package com.deayalar.rodandov2.callbacks;

import org.json.JSONException;
import org.json.JSONObject;

import android.util.Log;

import com.deayalar.rodandov2.utils.Constantes;
import com.turbomanage.httpclient.AsyncCallback;
import com.turbomanage.httpclient.HttpResponse;

public class LoginCallback extends AsyncCallback {

	JSONObject responseJSON;
	
	@Override
    public void onComplete(HttpResponse httpResponse) {
    	String response = httpResponse.getBodyAsString();
        try {
        	responseJSON = new JSONObject(response);
			
		} catch (JSONException e) {
			Log.e(Constantes.tag, e.getMessage(), e);
		}	         
    }
    @Override
    public void onError(Exception e) {
    	Log.e(Constantes.tag, e.getMessage(), e);
    }
    
    
    public JSONObject getResponse() {
    	return responseJSON;
    } 
}
